//
//  SpatialDataCache.h
//  geom
//
//  Created by 徐洋 on 2018/8/31.
//  Copyright © 2018年 徐洋. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#include <sqlite3.h>
#include "gaiageo.h"

@interface SpatialObject : NSObject

@property (nonatomic, assign) gaiaGeomCollPtr geometry;

+ (instancetype)spatialObjectWithBlob:(NSData *)blob;

@end

@interface SpatialiteDataCache : NSObject

@property (nonatomic, readonly) NSString * databaseFile;

@property (nonatomic, assign) int srid;
@property (nonatomic, assign) CGRect bounds;
@property (nonatomic, strong) NSArray<SpatialObject *> * arrAirports;
@property (nonatomic, strong) NSArray<SpatialObject *> * arrAirspaces;
@property (nonatomic, strong) NSArray<SpatialObject *> * arrRestrictedAreas;
@property (nonatomic, strong) NSArray<SpatialObject *> * arrAirwaySegments;

- (id)initWithSpaliteFile:(NSString *)dbFile;

- (void)refreshCache;


@end
